{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "71e773c8-254a-44fd-9f81-58901902ff3d",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import json\n",
    "from sklearn.model_selection import train_test_split\n",
    "from tensorflow.keras.models import Sequential\n",
    "from tensorflow.keras.layers import Conv1D, MaxPooling1D, BatchNormalization, Dropout, Dense, Flatten,Input,GlobalAveragePooling1D\n",
    "from tensorflow.keras.metrics import R2Score,MeanAbsolutePercentageError\n",
    "from tensorflow.keras.callbacks import EarlyStopping,ReduceLROnPlateau\n",
    "from tensorflow.keras.optimizers import Adam\n",
    "from tensorflow.keras.regularizers import l2\n",
    "from sklearn.preprocessing import StandardScaler\n",
    "from tensorflow.keras import layers, models, regularizers\n",
    "import tensorflow as tf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "59db93fe-135a-42c7-b197-7af90070fcb0",
   "metadata": {},
   "outputs": [],
   "source": [
    "df=pd.read_csv(\"pp_ecg_preprocessedSignalLarge.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "a2d27cca-b5c2-4bba-bb76-276d93882a42",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>caseid</th>\n",
       "      <th>dt</th>\n",
       "      <th>result</th>\n",
       "      <th>ppg_tid</th>\n",
       "      <th>ecg_tid</th>\n",
       "      <th>ppg_signal</th>\n",
       "      <th>ecg_signal</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>3060.0</td>\n",
       "      <td>154.0</td>\n",
       "      <td>9acbed98f1f15c7827ee3bcc55eaef19f861b824</td>\n",
       "      <td>8c9161aaae8cb578e2aa7b60f44234d98d2b3344</td>\n",
       "      <td>[-1.5116935159800502, -2.6001532337322755, -3....</td>\n",
       "      <td>[-4.635602658133209, -3.924501035151671, -2.77...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>3060.0</td>\n",
       "      <td>154.0</td>\n",
       "      <td>9acbed98f1f15c7827ee3bcc55eaef19f861b824</td>\n",
       "      <td>8c9161aaae8cb578e2aa7b60f44234d98d2b3344</td>\n",
       "      <td>[-2.0239566627080916, -2.8439508903118993, -3....</td>\n",
       "      <td>[-4.698922745411354, -3.3754397274073, -1.7596...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>3060.0</td>\n",
       "      <td>154.0</td>\n",
       "      <td>9acbed98f1f15c7827ee3bcc55eaef19f861b824</td>\n",
       "      <td>8c9161aaae8cb578e2aa7b60f44234d98d2b3344</td>\n",
       "      <td>[-2.1229598869289186, -3.148025636945019, -4.0...</td>\n",
       "      <td>[3.1132789651423773, 3.490500268912875, 3.7903...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>3060.0</td>\n",
       "      <td>154.0</td>\n",
       "      <td>9acbed98f1f15c7827ee3bcc55eaef19f861b824</td>\n",
       "      <td>8c9161aaae8cb578e2aa7b60f44234d98d2b3344</td>\n",
       "      <td>[-2.5874447985985203, -3.394867110376111, -4.1...</td>\n",
       "      <td>[-0.83490506168045, -0.835910708782481, -0.835...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>3060.0</td>\n",
       "      <td>154.0</td>\n",
       "      <td>9acbed98f1f15c7827ee3bcc55eaef19f861b824</td>\n",
       "      <td>8c9161aaae8cb578e2aa7b60f44234d98d2b3344</td>\n",
       "      <td>[-0.7960797549960681, -1.7471838487999183, -2....</td>\n",
       "      <td>[-1.8446166839141898, -1.418030027366001, -0.7...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Unnamed: 0  caseid      dt  result  \\\n",
       "0           0       1  3060.0   154.0   \n",
       "1           0       1  3060.0   154.0   \n",
       "2           0       1  3060.0   154.0   \n",
       "3           0       1  3060.0   154.0   \n",
       "4           0       1  3060.0   154.0   \n",
       "\n",
       "                                    ppg_tid  \\\n",
       "0  9acbed98f1f15c7827ee3bcc55eaef19f861b824   \n",
       "1  9acbed98f1f15c7827ee3bcc55eaef19f861b824   \n",
       "2  9acbed98f1f15c7827ee3bcc55eaef19f861b824   \n",
       "3  9acbed98f1f15c7827ee3bcc55eaef19f861b824   \n",
       "4  9acbed98f1f15c7827ee3bcc55eaef19f861b824   \n",
       "\n",
       "                                    ecg_tid  \\\n",
       "0  8c9161aaae8cb578e2aa7b60f44234d98d2b3344   \n",
       "1  8c9161aaae8cb578e2aa7b60f44234d98d2b3344   \n",
       "2  8c9161aaae8cb578e2aa7b60f44234d98d2b3344   \n",
       "3  8c9161aaae8cb578e2aa7b60f44234d98d2b3344   \n",
       "4  8c9161aaae8cb578e2aa7b60f44234d98d2b3344   \n",
       "\n",
       "                                          ppg_signal  \\\n",
       "0  [-1.5116935159800502, -2.6001532337322755, -3....   \n",
       "1  [-2.0239566627080916, -2.8439508903118993, -3....   \n",
       "2  [-2.1229598869289186, -3.148025636945019, -4.0...   \n",
       "3  [-2.5874447985985203, -3.394867110376111, -4.1...   \n",
       "4  [-0.7960797549960681, -1.7471838487999183, -2....   \n",
       "\n",
       "                                          ecg_signal  \n",
       "0  [-4.635602658133209, -3.924501035151671, -2.77...  \n",
       "1  [-4.698922745411354, -3.3754397274073, -1.7596...  \n",
       "2  [3.1132789651423773, 3.490500268912875, 3.7903...  \n",
       "3  [-0.83490506168045, -0.835910708782481, -0.835...  \n",
       "4  [-1.8446166839141898, -1.418030027366001, -0.7...  "
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "c8442955-d906-425b-9bf8-fb9745394704",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(11532, 8)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "c62e3bba-f6a9-4f64-98d9-a2384cd98407",
   "metadata": {},
   "outputs": [],
   "source": [
    "def check_min_sample_size(df):\n",
    "    mn = float('inf')  # More readable than 1e9\n",
    "    for index,row in df.iterrows():\n",
    "        if np.isnan(row[\"result\"]):\n",
    "            continue\n",
    "        ppg_signal=json.loads(row[\"ppg_signal\"])\n",
    "        ecg_signal=json.loads(row[\"ecg_signal\"])\n",
    "        if len(ppg_signal)!=100 or len(ecg_signal)!=100:\n",
    "            print(index,len(ppg_signal),len(ecg_signal))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "615529d7-53e4-4032-929a-a12f841b9a63",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = df.drop(9875)  # Drops the row with index 5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "18bfc24b-be9b-48cd-b134-5ae10103c222",
   "metadata": {},
   "outputs": [],
   "source": [
    "check_min_sample_size(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "f15cd446-d8d2-4771-abef-a8a7dba7052b",
   "metadata": {},
   "outputs": [],
   "source": [
    "def create_X_and_Y_from_df(df):\n",
    "    X=[]\n",
    "    Y=[]\n",
    "    for index,row in df.iterrows():\n",
    "        if np.isnan(row[\"result\"]):\n",
    "            continue\n",
    "        ppg_signal=json.loads(row[\"ppg_signal\"])\n",
    "        ecg_signal=json.loads(row[\"ecg_signal\"])\n",
    "        oneD_image=[]\n",
    "        for i in range(len(ppg_signal)):\n",
    "            oneD_image.append([ppg_signal[i],ecg_signal[i]])\n",
    "        X.append(oneD_image)\n",
    "        Y.append(row[\"result\"])\n",
    "    X=np.array(X)\n",
    "    Y=np.array(Y)\n",
    "    return X,Y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "1ce2d9b1-5abf-4715-959e-e978fb4720e0",
   "metadata": {},
   "outputs": [],
   "source": [
    "X,Y=create_X_and_Y_from_df(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "835deb39-639c-41bb-910c-da942b42c263",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(8951, 100, 2)"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "299f496b-b19d-4d51-a5f7-94ead29e28f7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(8951,)"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Y.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "27fb2772-b1ac-4691-baa4-b498315d7fc1",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Standardize each signal type separately\n",
    "for i in range(X.shape[2]):\n",
    "    X[:,:,i] = (X[:,:,i] - X[:,:,i].mean()) / X[:,:,i].std()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "d4a74b74-9ac2-49d1-80b9-382281a89778",
   "metadata": {},
   "outputs": [],
   "source": [
    "X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=0.2, random_state=42)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "c04a0711-eee5-475c-b515-af45720448bc",
   "metadata": {},
   "outputs": [],
   "source": [
    "model = Sequential()\n",
    "\n",
    "model.add(Input(shape=(100, 2)))\n",
    "\n",
    "# Input shape (100 timesteps, 2 features)\n",
    "model.add(Conv1D(64, 5, activation='relu', kernel_regularizer=l2(0.001), \n",
    "                 kernel_initializer='he_normal'))\n",
    "model.add(BatchNormalization())\n",
    "model.add(MaxPooling1D(2))\n",
    "model.add(Dropout(0.3))\n",
    "\n",
    "model.add(Conv1D(128, 3, activation='relu', kernel_regularizer=l2(0.001),\n",
    "                kernel_initializer='he_normal'))\n",
    "model.add(BatchNormalization())\n",
    "model.add(MaxPooling1D(2))\n",
    "model.add(Dropout(0.3))\n",
    "\n",
    "model.add(Conv1D(256, 3, activation='relu', kernel_regularizer=l2(0.001),\n",
    "                kernel_initializer='he_normal'))\n",
    "model.add(BatchNormalization())\n",
    "model.add(MaxPooling1D(2))\n",
    "model.add(Dropout(0.4))\n",
    "\n",
    "# Better alternative to Flatten for temporal data\n",
    "model.add(GlobalAveragePooling1D())\n",
    "\n",
    "model.add(Dense(256, activation='relu', kernel_regularizer=l2(0.001)))\n",
    "model.add(BatchNormalization())\n",
    "model.add(Dropout(0.5))\n",
    "\n",
    "# Output layer for regression\n",
    "model.add(Dense(1, activation='linear'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "faf015c5-5622-4c4f-b021-98c3926b1cd3",
   "metadata": {},
   "outputs": [],
   "source": [
    "adam = Adam(learning_rate=0.0001)\n",
    "model.compile(\n",
    "    optimizer=adam,\n",
    "    loss='mean_squared_error',  # For regression, you typically use 'mse' or 'mae' as loss\n",
    "    metrics=[\n",
    "        'mae',  # Mean Absolute Error\n",
    "        'mse',  # Mean Squared Error\n",
    "        R2Score(),  # R² (R-squared)\n",
    "        MeanAbsolutePercentageError()\n",
    "    ]\n",
    ")\n",
    "lr_schedule = ReduceLROnPlateau(\n",
    "    monitor='val_loss', factor=0.5, patience=5, min_lr=1e-6\n",
    ")\n",
    "es = EarlyStopping(monitor='val_loss', patience=15, restore_best_weights=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "31aed7b1-d874-4d4a-9648-a6e7238f49b0",
   "metadata": {},
   "outputs": [],
   "source": [
    "history = model.fit(\n",
    "    X_train, Y_train,\n",
    "    epochs=200,\n",
    "    batch_size=64,\n",
    "    validation_split=0.2,\n",
    "    callbacks=[lr_schedule, es]\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "da1625d4-fb8a-48b8-b4ee-794a50d0578b",
   "metadata": {},
   "outputs": [],
   "source": [
    "y=Y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "4e89a92f-18ed-49e1-a8e1-cf780abc4694",
   "metadata": {},
   "outputs": [],
   "source": [
    "valid_mask = (y >= 70) & (y <= 250)\n",
    "X = X[valid_mask]\n",
    "y = y[valid_mask]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "c076ad6e-887d-48fc-a804-c2b0f54322c2",
   "metadata": {},
   "outputs": [],
   "source": [
    "def normalize_channels(X):\n",
    "    X_normalized = np.zeros_like(X)\n",
    "    for i in range(X.shape[-1]):\n",
    "        channel = X[..., i]\n",
    "        scaler = StandardScaler()\n",
    "        X_normalized[..., i] = scaler.fit_transform(channel.reshape(-1, 1)).reshape(channel.shape)\n",
    "    return X_normalized"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "41d3bb66-49c6-4002-98b3-eee73f2af06c",
   "metadata": {},
   "outputs": [],
   "source": [
    "X = normalize_channels(X)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "d87ed9b6-f7a6-4174-a3d1-d0ae39e14266",
   "metadata": {},
   "outputs": [],
   "source": [
    "X_train, X_temp, y_train, y_temp = train_test_split(X, y, test_size=0.3, random_state=42)\n",
    "X_val, X_test, y_val, y_test = train_test_split(X_temp, y_temp, test_size=0.5, random_state=42)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "b413a908-a381-4d2a-92f2-296790b5aa50",
   "metadata": {},
   "outputs": [],
   "source": [
    "class SignalAugmenter(layers.Layer):\n",
    "    def __init__(self, noise_std=0.05, **kwargs):\n",
    "        super().__init__(**kwargs)\n",
    "        self.noise_std = noise_std\n",
    "\n",
    "    def call(self, inputs, training=None):\n",
    "        if training:\n",
    "            noise = tf.random.normal(tf.shape(inputs), stddev=self.noise_std)\n",
    "            return inputs + noise\n",
    "        return inputs\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "4fb915a2-8fd9-4d76-a400-66799b9d29e1",
   "metadata": {},
   "outputs": [],
   "source": [
    "from tensorflow.keras import layers, Model\n",
    "\n",
    "def build_bgl_model(input_shape=(100, 2)):\n",
    "    # Input layer\n",
    "    inp = layers.Input(shape=input_shape)\n",
    "    \n",
    "    # Conv Block 1\n",
    "    x = layers.Conv1D(64, kernel_size=7, activation='relu', padding='same')(inp)\n",
    "    x = layers.BatchNormalization()(x)\n",
    "    x = layers.MaxPooling1D(pool_size=2)(x)\n",
    "\n",
    "    # Conv Block 2\n",
    "    x = layers.Conv1D(128, kernel_size=5, activation='relu', padding='same')(x)\n",
    "    x = layers.BatchNormalization()(x)\n",
    "\n",
    "    # Conv Block 3\n",
    "    x = layers.Conv1D(256, kernel_size=3, activation='relu', padding='same')(x)\n",
    "    x = layers.BatchNormalization()(x)\n",
    "\n",
    "    # Global pooling\n",
    "    x = layers.GlobalAveragePooling1D()(x)\n",
    "\n",
    "    # Dense layers\n",
    "    x = layers.Dense(128, activation='relu')(x)\n",
    "    x = layers.Dropout(0.5)(x)\n",
    "    out = layers.Dense(1)(x)\n",
    "\n",
    "    # Build model\n",
    "    model = Model(inputs=inp, outputs=out, name=\"Enhanced_Model\")\n",
    "    return model\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "d7536cb6-c60c-4cf1-9680-a2cfa77a1d55",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\">Model: \"Enhanced_Model\"</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[1mModel: \"Enhanced_Model\"\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓\n",
       "┃<span style=\"font-weight: bold\"> Layer (type)                         </span>┃<span style=\"font-weight: bold\"> Output Shape                </span>┃<span style=\"font-weight: bold\">         Param # </span>┃\n",
       "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩\n",
       "│ input_layer_1 (<span style=\"color: #0087ff; text-decoration-color: #0087ff\">InputLayer</span>)           │ (<span style=\"color: #00d7ff; text-decoration-color: #00d7ff\">None</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">100</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">2</span>)              │               <span style=\"color: #00af00; text-decoration-color: #00af00\">0</span> │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ conv1d_2 (<span style=\"color: #0087ff; text-decoration-color: #0087ff\">Conv1D</span>)                    │ (<span style=\"color: #00d7ff; text-decoration-color: #00d7ff\">None</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">100</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">64</span>)             │             <span style=\"color: #00af00; text-decoration-color: #00af00\">960</span> │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ batch_normalization_2                │ (<span style=\"color: #00d7ff; text-decoration-color: #00d7ff\">None</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">100</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">64</span>)             │             <span style=\"color: #00af00; text-decoration-color: #00af00\">256</span> │\n",
       "│ (<span style=\"color: #0087ff; text-decoration-color: #0087ff\">BatchNormalization</span>)                 │                             │                 │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ max_pooling1d_1 (<span style=\"color: #0087ff; text-decoration-color: #0087ff\">MaxPooling1D</span>)       │ (<span style=\"color: #00d7ff; text-decoration-color: #00d7ff\">None</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">50</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">64</span>)              │               <span style=\"color: #00af00; text-decoration-color: #00af00\">0</span> │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ conv1d_3 (<span style=\"color: #0087ff; text-decoration-color: #0087ff\">Conv1D</span>)                    │ (<span style=\"color: #00d7ff; text-decoration-color: #00d7ff\">None</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">50</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">128</span>)             │          <span style=\"color: #00af00; text-decoration-color: #00af00\">41,088</span> │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ batch_normalization_3                │ (<span style=\"color: #00d7ff; text-decoration-color: #00d7ff\">None</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">50</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">128</span>)             │             <span style=\"color: #00af00; text-decoration-color: #00af00\">512</span> │\n",
       "│ (<span style=\"color: #0087ff; text-decoration-color: #0087ff\">BatchNormalization</span>)                 │                             │                 │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ conv1d_4 (<span style=\"color: #0087ff; text-decoration-color: #0087ff\">Conv1D</span>)                    │ (<span style=\"color: #00d7ff; text-decoration-color: #00d7ff\">None</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">50</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">256</span>)             │          <span style=\"color: #00af00; text-decoration-color: #00af00\">98,560</span> │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ batch_normalization_4                │ (<span style=\"color: #00d7ff; text-decoration-color: #00d7ff\">None</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">50</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">256</span>)             │           <span style=\"color: #00af00; text-decoration-color: #00af00\">1,024</span> │\n",
       "│ (<span style=\"color: #0087ff; text-decoration-color: #0087ff\">BatchNormalization</span>)                 │                             │                 │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ global_average_pooling1d_1           │ (<span style=\"color: #00d7ff; text-decoration-color: #00d7ff\">None</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">256</span>)                 │               <span style=\"color: #00af00; text-decoration-color: #00af00\">0</span> │\n",
       "│ (<span style=\"color: #0087ff; text-decoration-color: #0087ff\">GlobalAveragePooling1D</span>)             │                             │                 │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ dense_2 (<span style=\"color: #0087ff; text-decoration-color: #0087ff\">Dense</span>)                      │ (<span style=\"color: #00d7ff; text-decoration-color: #00d7ff\">None</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">128</span>)                 │          <span style=\"color: #00af00; text-decoration-color: #00af00\">32,896</span> │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ dropout_2 (<span style=\"color: #0087ff; text-decoration-color: #0087ff\">Dropout</span>)                  │ (<span style=\"color: #00d7ff; text-decoration-color: #00d7ff\">None</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">128</span>)                 │               <span style=\"color: #00af00; text-decoration-color: #00af00\">0</span> │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ dense_3 (<span style=\"color: #0087ff; text-decoration-color: #0087ff\">Dense</span>)                      │ (<span style=\"color: #00d7ff; text-decoration-color: #00d7ff\">None</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">1</span>)                   │             <span style=\"color: #00af00; text-decoration-color: #00af00\">129</span> │\n",
       "└──────────────────────────────────────┴─────────────────────────────┴─────────────────┘\n",
       "</pre>\n"
      ],
      "text/plain": [
       "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓\n",
       "┃\u001b[1m \u001b[0m\u001b[1mLayer (type)                        \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mOutput Shape               \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m        Param #\u001b[0m\u001b[1m \u001b[0m┃\n",
       "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩\n",
       "│ input_layer_1 (\u001b[38;5;33mInputLayer\u001b[0m)           │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;34m100\u001b[0m, \u001b[38;5;34m2\u001b[0m)              │               \u001b[38;5;34m0\u001b[0m │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ conv1d_2 (\u001b[38;5;33mConv1D\u001b[0m)                    │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;34m100\u001b[0m, \u001b[38;5;34m64\u001b[0m)             │             \u001b[38;5;34m960\u001b[0m │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ batch_normalization_2                │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;34m100\u001b[0m, \u001b[38;5;34m64\u001b[0m)             │             \u001b[38;5;34m256\u001b[0m │\n",
       "│ (\u001b[38;5;33mBatchNormalization\u001b[0m)                 │                             │                 │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ max_pooling1d_1 (\u001b[38;5;33mMaxPooling1D\u001b[0m)       │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;34m50\u001b[0m, \u001b[38;5;34m64\u001b[0m)              │               \u001b[38;5;34m0\u001b[0m │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ conv1d_3 (\u001b[38;5;33mConv1D\u001b[0m)                    │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;34m50\u001b[0m, \u001b[38;5;34m128\u001b[0m)             │          \u001b[38;5;34m41,088\u001b[0m │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ batch_normalization_3                │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;34m50\u001b[0m, \u001b[38;5;34m128\u001b[0m)             │             \u001b[38;5;34m512\u001b[0m │\n",
       "│ (\u001b[38;5;33mBatchNormalization\u001b[0m)                 │                             │                 │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ conv1d_4 (\u001b[38;5;33mConv1D\u001b[0m)                    │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;34m50\u001b[0m, \u001b[38;5;34m256\u001b[0m)             │          \u001b[38;5;34m98,560\u001b[0m │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ batch_normalization_4                │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;34m50\u001b[0m, \u001b[38;5;34m256\u001b[0m)             │           \u001b[38;5;34m1,024\u001b[0m │\n",
       "│ (\u001b[38;5;33mBatchNormalization\u001b[0m)                 │                             │                 │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ global_average_pooling1d_1           │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;34m256\u001b[0m)                 │               \u001b[38;5;34m0\u001b[0m │\n",
       "│ (\u001b[38;5;33mGlobalAveragePooling1D\u001b[0m)             │                             │                 │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ dense_2 (\u001b[38;5;33mDense\u001b[0m)                      │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;34m128\u001b[0m)                 │          \u001b[38;5;34m32,896\u001b[0m │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ dropout_2 (\u001b[38;5;33mDropout\u001b[0m)                  │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;34m128\u001b[0m)                 │               \u001b[38;5;34m0\u001b[0m │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ dense_3 (\u001b[38;5;33mDense\u001b[0m)                      │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;34m1\u001b[0m)                   │             \u001b[38;5;34m129\u001b[0m │\n",
       "└──────────────────────────────────────┴─────────────────────────────┴─────────────────┘\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\"> Total params: </span><span style=\"color: #00af00; text-decoration-color: #00af00\">175,425</span> (685.25 KB)\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[1m Total params: \u001b[0m\u001b[38;5;34m175,425\u001b[0m (685.25 KB)\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\"> Trainable params: </span><span style=\"color: #00af00; text-decoration-color: #00af00\">174,529</span> (681.75 KB)\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[1m Trainable params: \u001b[0m\u001b[38;5;34m174,529\u001b[0m (681.75 KB)\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\"> Non-trainable params: </span><span style=\"color: #00af00; text-decoration-color: #00af00\">896</span> (3.50 KB)\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[1m Non-trainable params: \u001b[0m\u001b[38;5;34m896\u001b[0m (3.50 KB)\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "model = build_bgl_model()\n",
    "model.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "5f7b7629-da0d-482c-8160-021acd54b2ea",
   "metadata": {},
   "outputs": [],
   "source": [
    "optimizer = Adam(\n",
    "    learning_rate=1e-4, \n",
    "    weight_decay=1e-6  # Explicit L2 regularization\n",
    ")\n",
    "\n",
    "model.compile(\n",
    "    optimizer=optimizer,\n",
    "    loss='huber',\n",
    "    metrics=['mae','mse', R2Score(),MeanAbsolutePercentageError()]\n",
    ")\n",
    "\n",
    "callbacks = [\n",
    "    EarlyStopping(patience=30, restore_best_weights=True),\n",
    "    ReduceLROnPlateau(factor=0.2, patience=10, verbose=1)\n",
    "]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "e262e533-cfd4-4842-a46b-9753309f5c27",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch 1/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m18s\u001b[0m 115ms/step - loss: 113.9970 - mae: 114.4970 - mean_absolute_percentage_error: 98.1490 - mse: 14245.3311 - r2_score: -11.6674 - val_loss: 112.9866 - val_mae: 113.4866 - val_mean_absolute_percentage_error: 98.4183 - val_mse: 13946.5352 - val_r2_score: -12.0523 - learning_rate: 1.0000e-04\n",
      "Epoch 2/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m18s\u001b[0m 89ms/step - loss: 106.6824 - mae: 107.1824 - mean_absolute_percentage_error: 91.8945 - mse: 12653.1094 - r2_score: -10.2665 - val_loss: 108.2647 - val_mae: 108.7647 - val_mean_absolute_percentage_error: 94.0901 - val_mse: 12890.7656 - val_r2_score: -11.0642 - learning_rate: 1.0000e-04\n",
      "Epoch 3/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 88ms/step - loss: 97.2908 - mae: 97.7908 - mean_absolute_percentage_error: 83.0504 - mse: 10765.3281 - r2_score: -8.7201 - val_loss: 94.7234 - val_mae: 95.2234 - val_mean_absolute_percentage_error: 81.7316 - val_mse: 10170.6182 - val_r2_score: -8.5185 - learning_rate: 1.0000e-04\n",
      "Epoch 4/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 86ms/step - loss: 80.8371 - mae: 81.3370 - mean_absolute_percentage_error: 67.8985 - mse: 7998.7476 - r2_score: -6.2431 - val_loss: 67.7582 - val_mae: 68.2580 - val_mean_absolute_percentage_error: 57.0617 - val_mse: 6203.4121 - val_r2_score: -4.8056 - learning_rate: 1.0000e-04\n",
      "Epoch 5/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 87ms/step - loss: 57.9225 - mae: 58.4209 - mean_absolute_percentage_error: 47.0690 - mse: 5130.1235 - r2_score: -3.4305 - val_loss: 46.8885 - val_mae: 47.3847 - val_mean_absolute_percentage_error: 39.2549 - val_mse: 3892.6484 - val_r2_score: -2.6430 - learning_rate: 1.0000e-04\n",
      "Epoch 6/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 90ms/step - loss: 45.0512 - mae: 45.5490 - mean_absolute_percentage_error: 37.0172 - mse: 3599.4219 - r2_score: -2.2103 - val_loss: 42.0133 - val_mae: 42.5095 - val_mean_absolute_percentage_error: 35.7814 - val_mse: 3128.5527 - val_r2_score: -1.9279 - learning_rate: 1.0000e-04\n",
      "Epoch 7/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 85ms/step - loss: 41.8987 - mae: 42.3954 - mean_absolute_percentage_error: 35.0887 - mse: 3122.5525 - r2_score: -1.8872 - val_loss: 37.1992 - val_mae: 37.6979 - val_mean_absolute_percentage_error: 31.0400 - val_mse: 2656.3386 - val_r2_score: -1.4860 - learning_rate: 1.0000e-04\n",
      "Epoch 8/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 87ms/step - loss: 40.6657 - mae: 41.1627 - mean_absolute_percentage_error: 33.5347 - mse: 3004.0479 - r2_score: -1.6369 - val_loss: 34.7162 - val_mae: 35.2114 - val_mean_absolute_percentage_error: 28.4439 - val_mse: 2442.8906 - val_r2_score: -1.2862 - learning_rate: 1.0000e-04\n",
      "Epoch 9/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 95ms/step - loss: 39.5690 - mae: 40.0658 - mean_absolute_percentage_error: 33.1657 - mse: 2826.7751 - r2_score: -1.5749 - val_loss: 34.2748 - val_mae: 34.7720 - val_mean_absolute_percentage_error: 28.1661 - val_mse: 2359.8508 - val_r2_score: -1.2085 - learning_rate: 1.0000e-04\n",
      "Epoch 10/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 111ms/step - loss: 39.0286 - mae: 39.5254 - mean_absolute_percentage_error: 32.1469 - mse: 2773.9243 - r2_score: -1.3965 - val_loss: 32.6999 - val_mae: 33.1959 - val_mean_absolute_percentage_error: 26.8371 - val_mse: 2193.3765 - val_r2_score: -1.0527 - learning_rate: 1.0000e-04\n",
      "Epoch 11/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m18s\u001b[0m 88ms/step - loss: 37.4238 - mae: 37.9203 - mean_absolute_percentage_error: 31.1859 - mse: 2536.0669 - r2_score: -1.3354 - val_loss: 32.3049 - val_mae: 32.8012 - val_mean_absolute_percentage_error: 26.3983 - val_mse: 2131.3252 - val_r2_score: -0.9947 - learning_rate: 1.0000e-04\n",
      "Epoch 12/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 89ms/step - loss: 37.0590 - mae: 37.5562 - mean_absolute_percentage_error: 30.7187 - mse: 2496.5769 - r2_score: -1.1397 - val_loss: 30.3120 - val_mae: 30.8064 - val_mean_absolute_percentage_error: 24.7458 - val_mse: 1895.1670 - val_r2_score: -0.7736 - learning_rate: 1.0000e-04\n",
      "Epoch 13/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 92ms/step - loss: 35.2667 - mae: 35.7629 - mean_absolute_percentage_error: 29.3319 - mse: 2327.7351 - r2_score: -1.1405 - val_loss: 29.6352 - val_mae: 30.1331 - val_mean_absolute_percentage_error: 24.1438 - val_mse: 1802.4929 - val_r2_score: -0.6869 - learning_rate: 1.0000e-04\n",
      "Epoch 14/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 86ms/step - loss: 35.3520 - mae: 35.8491 - mean_absolute_percentage_error: 29.1756 - mse: 2316.4915 - r2_score: -1.1075 - val_loss: 28.0696 - val_mae: 28.5661 - val_mean_absolute_percentage_error: 22.9999 - val_mse: 1600.5109 - val_r2_score: -0.4979 - learning_rate: 1.0000e-04\n",
      "Epoch 15/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 97ms/step - loss: 33.5247 - mae: 34.0202 - mean_absolute_percentage_error: 27.3330 - mse: 2166.3931 - r2_score: -0.9250 - val_loss: 27.5060 - val_mae: 28.0018 - val_mean_absolute_percentage_error: 23.0738 - val_mse: 1452.9106 - val_r2_score: -0.3597 - learning_rate: 1.0000e-04\n",
      "Epoch 16/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m8s\u001b[0m 75ms/step - loss: 31.9458 - mae: 32.4414 - mean_absolute_percentage_error: 26.0348 - mse: 1964.3439 - r2_score: -0.7300 - val_loss: 25.4575 - val_mae: 25.9528 - val_mean_absolute_percentage_error: 21.0733 - val_mse: 1316.6617 - val_r2_score: -0.2322 - learning_rate: 1.0000e-04\n",
      "Epoch 17/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 115ms/step - loss: 31.1281 - mae: 31.6236 - mean_absolute_percentage_error: 25.5265 - mse: 1871.4833 - r2_score: -0.7018 - val_loss: 24.7230 - val_mae: 25.2196 - val_mean_absolute_percentage_error: 20.0901 - val_mse: 1296.6442 - val_r2_score: -0.2135 - learning_rate: 1.0000e-04\n",
      "Epoch 18/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m18s\u001b[0m 89ms/step - loss: 29.6138 - mae: 30.1103 - mean_absolute_percentage_error: 24.0958 - mse: 1710.7083 - r2_score: -0.5440 - val_loss: 24.4525 - val_mae: 24.9479 - val_mean_absolute_percentage_error: 20.0749 - val_mse: 1258.9299 - val_r2_score: -0.1782 - learning_rate: 1.0000e-04\n",
      "Epoch 19/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 115ms/step - loss: 31.5057 - mae: 32.0018 - mean_absolute_percentage_error: 25.3905 - mse: 1909.4238 - r2_score: -0.7018 - val_loss: 23.9900 - val_mae: 24.4833 - val_mean_absolute_percentage_error: 19.5184 - val_mse: 1239.8657 - val_r2_score: -0.1604 - learning_rate: 1.0000e-04\n",
      "Epoch 20/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 110ms/step - loss: 29.5592 - mae: 30.0546 - mean_absolute_percentage_error: 24.1636 - mse: 1738.6499 - r2_score: -0.5454 - val_loss: 24.5356 - val_mae: 25.0316 - val_mean_absolute_percentage_error: 20.5516 - val_mse: 1213.1676 - val_r2_score: -0.1354 - learning_rate: 1.0000e-04\n",
      "Epoch 21/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m19s\u001b[0m 90ms/step - loss: 28.8488 - mae: 29.3456 - mean_absolute_percentage_error: 23.8404 - mse: 1614.4911 - r2_score: -0.5152 - val_loss: 23.9549 - val_mae: 24.4477 - val_mean_absolute_percentage_error: 19.5037 - val_mse: 1241.6158 - val_r2_score: -0.1620 - learning_rate: 1.0000e-04\n",
      "Epoch 22/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 95ms/step - loss: 29.6761 - mae: 30.1724 - mean_absolute_percentage_error: 24.1188 - mse: 1713.8173 - r2_score: -0.5074 - val_loss: 23.9150 - val_mae: 24.4104 - val_mean_absolute_percentage_error: 19.7728 - val_mse: 1200.6888 - val_r2_score: -0.1237 - learning_rate: 1.0000e-04\n",
      "Epoch 23/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 99ms/step - loss: 28.9929 - mae: 29.4890 - mean_absolute_percentage_error: 23.7770 - mse: 1628.6932 - r2_score: -0.4677 - val_loss: 24.7120 - val_mae: 25.2079 - val_mean_absolute_percentage_error: 20.9280 - val_mse: 1211.6884 - val_r2_score: -0.1340 - learning_rate: 1.0000e-04\n",
      "Epoch 24/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m8s\u001b[0m 83ms/step - loss: 29.0754 - mae: 29.5713 - mean_absolute_percentage_error: 23.7677 - mse: 1637.4037 - r2_score: -0.4579 - val_loss: 23.3486 - val_mae: 23.8444 - val_mean_absolute_percentage_error: 19.0262 - val_mse: 1187.8147 - val_r2_score: -0.1116 - learning_rate: 1.0000e-04\n",
      "Epoch 25/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 106ms/step - loss: 28.5422 - mae: 29.0375 - mean_absolute_percentage_error: 23.3455 - mse: 1576.2242 - r2_score: -0.4289 - val_loss: 24.1202 - val_mae: 24.6163 - val_mean_absolute_percentage_error: 20.4403 - val_mse: 1158.4137 - val_r2_score: -0.0841 - learning_rate: 1.0000e-04\n",
      "Epoch 26/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 103ms/step - loss: 28.3535 - mae: 28.8498 - mean_absolute_percentage_error: 23.1654 - mse: 1577.6265 - r2_score: -0.4533 - val_loss: 23.8472 - val_mae: 24.3427 - val_mean_absolute_percentage_error: 19.8368 - val_mse: 1185.1870 - val_r2_score: -0.1092 - learning_rate: 1.0000e-04\n",
      "Epoch 27/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m8s\u001b[0m 83ms/step - loss: 28.6013 - mae: 29.0964 - mean_absolute_percentage_error: 23.4143 - mse: 1595.9225 - r2_score: -0.3684 - val_loss: 23.6242 - val_mae: 24.1199 - val_mean_absolute_percentage_error: 19.6463 - val_mse: 1162.8223 - val_r2_score: -0.0883 - learning_rate: 1.0000e-04\n",
      "Epoch 28/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m8s\u001b[0m 83ms/step - loss: 28.7686 - mae: 29.2645 - mean_absolute_percentage_error: 23.3098 - mse: 1645.4264 - r2_score: -0.4393 - val_loss: 23.4392 - val_mae: 23.9344 - val_mean_absolute_percentage_error: 18.5208 - val_mse: 1267.9319 - val_r2_score: -0.1866 - learning_rate: 1.0000e-04\n",
      "Epoch 29/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 110ms/step - loss: 28.7812 - mae: 29.2760 - mean_absolute_percentage_error: 23.1902 - mse: 1655.9795 - r2_score: -0.4241 - val_loss: 23.4394 - val_mae: 23.9345 - val_mean_absolute_percentage_error: 19.0440 - val_mse: 1204.9979 - val_r2_score: -0.1277 - learning_rate: 1.0000e-04\n",
      "Epoch 30/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 94ms/step - loss: 28.2448 - mae: 28.7418 - mean_absolute_percentage_error: 22.7707 - mse: 1593.1073 - r2_score: -0.4171 - val_loss: 23.3747 - val_mae: 23.8691 - val_mean_absolute_percentage_error: 18.7704 - val_mse: 1223.4241 - val_r2_score: -0.1450 - learning_rate: 1.0000e-04\n",
      "Epoch 31/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 105ms/step - loss: 27.9505 - mae: 28.4465 - mean_absolute_percentage_error: 23.1121 - mse: 1514.6885 - r2_score: -0.3691 - val_loss: 23.4293 - val_mae: 23.9244 - val_mean_absolute_percentage_error: 19.0621 - val_mse: 1191.9185 - val_r2_score: -0.1155 - learning_rate: 1.0000e-04\n",
      "Epoch 32/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 95ms/step - loss: 28.0042 - mae: 28.4992 - mean_absolute_percentage_error: 22.8568 - mse: 1556.4747 - r2_score: -0.4179 - val_loss: 24.6193 - val_mae: 25.1129 - val_mean_absolute_percentage_error: 20.8302 - val_mse: 1213.6849 - val_r2_score: -0.1359 - learning_rate: 1.0000e-04\n",
      "Epoch 33/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 89ms/step - loss: 28.0950 - mae: 28.5914 - mean_absolute_percentage_error: 22.8376 - mse: 1557.0623 - r2_score: -0.3956 - val_loss: 23.7239 - val_mae: 24.2186 - val_mean_absolute_percentage_error: 19.3858 - val_mse: 1225.5660 - val_r2_score: -0.1470 - learning_rate: 1.0000e-04\n",
      "Epoch 34/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 90ms/step - loss: 27.4110 - mae: 27.9066 - mean_absolute_percentage_error: 22.6504 - mse: 1489.2914 - r2_score: -0.3904\n",
      "Epoch 34: ReduceLROnPlateau reducing learning rate to 1.9999999494757503e-05.\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 96ms/step - loss: 27.4156 - mae: 27.9112 - mean_absolute_percentage_error: 22.6505 - mse: 1490.0131 - r2_score: -0.3904 - val_loss: 24.1000 - val_mae: 24.5953 - val_mean_absolute_percentage_error: 20.3043 - val_mse: 1180.3049 - val_r2_score: -0.1046 - learning_rate: 1.0000e-04\n",
      "Epoch 35/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 99ms/step - loss: 27.9023 - mae: 28.3975 - mean_absolute_percentage_error: 22.7559 - mse: 1548.1464 - r2_score: -0.3486 - val_loss: 23.2904 - val_mae: 23.7850 - val_mean_absolute_percentage_error: 19.1992 - val_mse: 1161.3739 - val_r2_score: -0.0869 - learning_rate: 2.0000e-05\n",
      "Epoch 36/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 91ms/step - loss: 27.1432 - mae: 27.6393 - mean_absolute_percentage_error: 22.1864 - mse: 1491.8635 - r2_score: -0.3553 - val_loss: 23.2078 - val_mae: 23.7017 - val_mean_absolute_percentage_error: 19.0264 - val_mse: 1166.2396 - val_r2_score: -0.0915 - learning_rate: 2.0000e-05\n",
      "Epoch 37/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 75ms/step - loss: 27.5589 - mae: 28.0543 - mean_absolute_percentage_error: 22.5330 - mse: 1497.2238 - r2_score: -0.3556 - val_loss: 23.2723 - val_mae: 23.7664 - val_mean_absolute_percentage_error: 19.0352 - val_mse: 1178.2054 - val_r2_score: -0.1027 - learning_rate: 2.0000e-05\n",
      "Epoch 38/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m8s\u001b[0m 83ms/step - loss: 26.6010 - mae: 27.0963 - mean_absolute_percentage_error: 21.8558 - mse: 1418.2550 - r2_score: -0.3345 - val_loss: 23.2084 - val_mae: 23.7041 - val_mean_absolute_percentage_error: 19.0226 - val_mse: 1168.1355 - val_r2_score: -0.0932 - learning_rate: 2.0000e-05\n",
      "Epoch 39/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m8s\u001b[0m 83ms/step - loss: 27.3318 - mae: 27.8268 - mean_absolute_percentage_error: 22.0983 - mse: 1533.4309 - r2_score: -0.3716 - val_loss: 23.2442 - val_mae: 23.7385 - val_mean_absolute_percentage_error: 19.0908 - val_mse: 1164.4167 - val_r2_score: -0.0898 - learning_rate: 2.0000e-05\n",
      "Epoch 40/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 97ms/step - loss: 27.7929 - mae: 28.2891 - mean_absolute_percentage_error: 22.5246 - mse: 1564.1830 - r2_score: -0.3264 - val_loss: 23.2108 - val_mae: 23.7054 - val_mean_absolute_percentage_error: 19.0872 - val_mse: 1160.6874 - val_r2_score: -0.0863 - learning_rate: 2.0000e-05\n",
      "Epoch 41/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 89ms/step - loss: 27.8227 - mae: 28.3194 - mean_absolute_percentage_error: 22.5905 - mse: 1532.9601 - r2_score: -0.3615 - val_loss: 23.4758 - val_mae: 23.9718 - val_mean_absolute_percentage_error: 19.4954 - val_mse: 1162.6989 - val_r2_score: -0.0881 - learning_rate: 2.0000e-05\n",
      "Epoch 42/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 88ms/step - loss: 27.8790 - mae: 28.3742 - mean_absolute_percentage_error: 22.3323 - mse: 1607.0376 - r2_score: -0.3955 - val_loss: 23.1093 - val_mae: 23.6049 - val_mean_absolute_percentage_error: 18.9073 - val_mse: 1162.5205 - val_r2_score: -0.0880 - learning_rate: 2.0000e-05\n",
      "Epoch 43/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 87ms/step - loss: 27.4055 - mae: 27.9009 - mean_absolute_percentage_error: 22.3689 - mse: 1504.5585 - r2_score: -0.3476 - val_loss: 23.2703 - val_mae: 23.7656 - val_mean_absolute_percentage_error: 19.2049 - val_mse: 1158.4952 - val_r2_score: -0.0842 - learning_rate: 2.0000e-05\n",
      "Epoch 44/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 90ms/step - loss: 27.4460 - mae: 27.9411 - mean_absolute_percentage_error: 22.2898 - mse: 1534.2961 - r2_score: -0.3812 - val_loss: 23.1386 - val_mae: 23.6334 - val_mean_absolute_percentage_error: 19.0068 - val_mse: 1159.6964 - val_r2_score: -0.0853 - learning_rate: 2.0000e-05\n",
      "Epoch 45/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 89ms/step - loss: 27.3125 - mae: 27.8080 - mean_absolute_percentage_error: 22.0798 - mse: 1490.0663 - r2_score: -0.3031 - val_loss: 23.1438 - val_mae: 23.6388 - val_mean_absolute_percentage_error: 18.9766 - val_mse: 1164.7611 - val_r2_score: -0.0901 - learning_rate: 2.0000e-05\n",
      "Epoch 46/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 110ms/step - loss: 27.4180 - mae: 27.9132 - mean_absolute_percentage_error: 22.3376 - mse: 1495.5538 - r2_score: -0.3195 - val_loss: 23.0927 - val_mae: 23.5868 - val_mean_absolute_percentage_error: 18.8323 - val_mse: 1169.6013 - val_r2_score: -0.0946 - learning_rate: 2.0000e-05\n",
      "Epoch 47/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m19s\u001b[0m 91ms/step - loss: 27.2122 - mae: 27.7081 - mean_absolute_percentage_error: 22.2674 - mse: 1477.5890 - r2_score: -0.3362 - val_loss: 23.2921 - val_mae: 23.7888 - val_mean_absolute_percentage_error: 19.2292 - val_mse: 1158.9858 - val_r2_score: -0.0847 - learning_rate: 2.0000e-05\n",
      "Epoch 48/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 94ms/step - loss: 28.0371 - mae: 28.5332 - mean_absolute_percentage_error: 22.4824 - mse: 1590.1681 - r2_score: -0.4070 - val_loss: 23.2174 - val_mae: 23.7105 - val_mean_absolute_percentage_error: 19.0383 - val_mse: 1168.8423 - val_r2_score: -0.0939 - learning_rate: 2.0000e-05\n",
      "Epoch 49/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 116ms/step - loss: 27.6090 - mae: 28.1048 - mean_absolute_percentage_error: 22.7220 - mse: 1485.5875 - r2_score: -0.3662 - val_loss: 23.2556 - val_mae: 23.7496 - val_mean_absolute_percentage_error: 19.0803 - val_mse: 1174.9303 - val_r2_score: -0.0996 - learning_rate: 2.0000e-05\n",
      "Epoch 50/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m18s\u001b[0m 88ms/step - loss: 27.5362 - mae: 28.0324 - mean_absolute_percentage_error: 22.2633 - mse: 1511.7041 - r2_score: -0.3101 - val_loss: 23.2591 - val_mae: 23.7537 - val_mean_absolute_percentage_error: 19.0966 - val_mse: 1169.9651 - val_r2_score: -0.0949 - learning_rate: 2.0000e-05\n",
      "Epoch 51/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 92ms/step - loss: 27.1108 - mae: 27.6056 - mean_absolute_percentage_error: 22.2162 - mse: 1443.1843 - r2_score: -0.3279 - val_loss: 23.6634 - val_mae: 24.1575 - val_mean_absolute_percentage_error: 19.7162 - val_mse: 1171.4121 - val_r2_score: -0.0963 - learning_rate: 2.0000e-05\n",
      "Epoch 52/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 92ms/step - loss: 27.5632 - mae: 28.0586 - mean_absolute_percentage_error: 22.1908 - mse: 1564.2412 - r2_score: -0.3701 - val_loss: 23.3159 - val_mae: 23.8113 - val_mean_absolute_percentage_error: 19.3009 - val_mse: 1156.8392 - val_r2_score: -0.0827 - learning_rate: 2.0000e-05\n",
      "Epoch 53/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 101ms/step - loss: 27.4320 - mae: 27.9274 - mean_absolute_percentage_error: 22.0645 - mse: 1504.4055 - r2_score: -0.3317 - val_loss: 22.9678 - val_mae: 23.4633 - val_mean_absolute_percentage_error: 18.6523 - val_mse: 1167.2653 - val_r2_score: -0.0924 - learning_rate: 2.0000e-05\n",
      "Epoch 54/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m8s\u001b[0m 83ms/step - loss: 27.4357 - mae: 27.9314 - mean_absolute_percentage_error: 22.3039 - mse: 1500.2759 - r2_score: -0.3775 - val_loss: 23.0899 - val_mae: 23.5847 - val_mean_absolute_percentage_error: 18.9003 - val_mse: 1162.5614 - val_r2_score: -0.0880 - learning_rate: 2.0000e-05\n",
      "Epoch 55/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 92ms/step - loss: 27.6527 - mae: 28.1489 - mean_absolute_percentage_error: 22.5266 - mse: 1546.8229 - r2_score: -0.3879 - val_loss: 23.2238 - val_mae: 23.7176 - val_mean_absolute_percentage_error: 19.1760 - val_mse: 1151.7563 - val_r2_score: -0.0779 - learning_rate: 2.0000e-05\n",
      "Epoch 56/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 87ms/step - loss: 27.6755 - mae: 28.1709 - mean_absolute_percentage_error: 22.7136 - mse: 1526.4049 - r2_score: -0.3503 - val_loss: 23.2438 - val_mae: 23.7384 - val_mean_absolute_percentage_error: 19.0086 - val_mse: 1176.1014 - val_r2_score: -0.1007 - learning_rate: 2.0000e-05\n",
      "Epoch 57/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 83ms/step - loss: 28.3590 - mae: 28.8543 - mean_absolute_percentage_error: 22.8278 - mse: 1611.3447 - r2_score: -0.3445 - val_loss: 23.1671 - val_mae: 23.6624 - val_mean_absolute_percentage_error: 19.0296 - val_mse: 1163.0806 - val_r2_score: -0.0885 - learning_rate: 2.0000e-05\n",
      "Epoch 58/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 90ms/step - loss: 26.8130 - mae: 27.3083 - mean_absolute_percentage_error: 21.8914 - mse: 1436.4370 - r2_score: -0.3139 - val_loss: 23.1519 - val_mae: 23.6470 - val_mean_absolute_percentage_error: 18.9974 - val_mse: 1162.8226 - val_r2_score: -0.0883 - learning_rate: 2.0000e-05\n",
      "Epoch 59/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 87ms/step - loss: 26.9258 - mae: 27.4219 - mean_absolute_percentage_error: 21.8830 - mse: 1456.1058 - r2_score: -0.3269 - val_loss: 23.0758 - val_mae: 23.5712 - val_mean_absolute_percentage_error: 18.9419 - val_mse: 1154.0989 - val_r2_score: -0.0801 - learning_rate: 2.0000e-05\n",
      "Epoch 60/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 92ms/step - loss: 27.2216 - mae: 27.7162 - mean_absolute_percentage_error: 22.1045 - mse: 1490.8191 - r2_score: -0.3773 - val_loss: 23.2203 - val_mae: 23.7159 - val_mean_absolute_percentage_error: 19.0853 - val_mse: 1165.8004 - val_r2_score: -0.0910 - learning_rate: 2.0000e-05\n",
      "Epoch 61/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 91ms/step - loss: 27.7669 - mae: 28.2631 - mean_absolute_percentage_error: 22.6415 - mse: 1507.8932 - r2_score: -0.3248 - val_loss: 23.0842 - val_mae: 23.5775 - val_mean_absolute_percentage_error: 18.9198 - val_mse: 1161.6190 - val_r2_score: -0.0871 - learning_rate: 2.0000e-05\n",
      "Epoch 62/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 93ms/step - loss: 27.0344 - mae: 27.5301 - mean_absolute_percentage_error: 21.8149 - mse: 1494.1750 - r2_score: -0.3038 - val_loss: 23.0123 - val_mae: 23.5077 - val_mean_absolute_percentage_error: 18.8489 - val_mse: 1153.7255 - val_r2_score: -0.0797 - learning_rate: 2.0000e-05\n",
      "Epoch 63/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 113ms/step - loss: 27.2933 - mae: 27.7885 - mean_absolute_percentage_error: 22.2290 - mse: 1471.6670 - r2_score: -0.3686 - val_loss: 22.9621 - val_mae: 23.4578 - val_mean_absolute_percentage_error: 18.7444 - val_mse: 1156.1199 - val_r2_score: -0.0820 - learning_rate: 2.0000e-05\n",
      "Epoch 64/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m18s\u001b[0m 89ms/step - loss: 27.3781 - mae: 27.8749 - mean_absolute_percentage_error: 22.2339 - mse: 1480.6842 - r2_score: -0.2720 - val_loss: 23.6622 - val_mae: 24.1569 - val_mean_absolute_percentage_error: 19.7212 - val_mse: 1170.9163 - val_r2_score: -0.0958 - learning_rate: 2.0000e-05\n",
      "Epoch 65/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 89ms/step - loss: 27.6680 - mae: 28.1644 - mean_absolute_percentage_error: 22.7285 - mse: 1500.2838 - r2_score: -0.3433 - val_loss: 23.4478 - val_mae: 23.9426 - val_mean_absolute_percentage_error: 19.4857 - val_mse: 1158.8170 - val_r2_score: -0.0845 - learning_rate: 2.0000e-05\n",
      "Epoch 66/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 91ms/step - loss: 26.6701 - mae: 27.1657 - mean_absolute_percentage_error: 21.4854 - mse: 1470.1255 - r2_score: -0.3069 - val_loss: 22.9411 - val_mae: 23.4355 - val_mean_absolute_percentage_error: 18.5877 - val_mse: 1167.7439 - val_r2_score: -0.0929 - learning_rate: 2.0000e-05\n",
      "Epoch 67/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 95ms/step - loss: 27.0856 - mae: 27.5812 - mean_absolute_percentage_error: 21.9202 - mse: 1499.9357 - r2_score: -0.3376 - val_loss: 22.9442 - val_mae: 23.4396 - val_mean_absolute_percentage_error: 18.6579 - val_mse: 1163.7751 - val_r2_score: -0.0892 - learning_rate: 2.0000e-05\n",
      "Epoch 68/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 117ms/step - loss: 27.0188 - mae: 27.5148 - mean_absolute_percentage_error: 21.9458 - mse: 1473.1080 - r2_score: -0.3415 - val_loss: 22.9927 - val_mae: 23.4890 - val_mean_absolute_percentage_error: 18.7275 - val_mse: 1163.8922 - val_r2_score: -0.0893 - learning_rate: 2.0000e-05\n",
      "Epoch 69/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m17s\u001b[0m 81ms/step - loss: 27.6217 - mae: 28.1163 - mean_absolute_percentage_error: 22.1942 - mse: 1539.8624 - r2_score: -0.3310 - val_loss: 23.1555 - val_mae: 23.6528 - val_mean_absolute_percentage_error: 18.9545 - val_mse: 1166.8774 - val_r2_score: -0.0921 - learning_rate: 2.0000e-05\n",
      "Epoch 70/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 89ms/step - loss: 27.4303 - mae: 27.9254 - mean_absolute_percentage_error: 22.0001 - mse: 1567.5566 - r2_score: -0.3366 - val_loss: 23.1248 - val_mae: 23.6199 - val_mean_absolute_percentage_error: 19.0010 - val_mse: 1156.0480 - val_r2_score: -0.0819 - learning_rate: 2.0000e-05\n",
      "Epoch 71/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m8s\u001b[0m 89ms/step - loss: 27.2810 - mae: 27.7758 - mean_absolute_percentage_error: 22.0459 - mse: 1518.4570 - r2_score: -0.3238 - val_loss: 23.0563 - val_mae: 23.5521 - val_mean_absolute_percentage_error: 18.9162 - val_mse: 1152.5796 - val_r2_score: -0.0787 - learning_rate: 2.0000e-05\n",
      "Epoch 72/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 89ms/step - loss: 26.6730 - mae: 27.1670 - mean_absolute_percentage_error: 21.6069 - mse: 1455.7471 - r2_score: -0.3021 - val_loss: 23.3403 - val_mae: 23.8368 - val_mean_absolute_percentage_error: 19.4167 - val_mse: 1146.9572 - val_r2_score: -0.0734 - learning_rate: 2.0000e-05\n",
      "Epoch 73/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m8s\u001b[0m 88ms/step - loss: 27.9268 - mae: 28.4236 - mean_absolute_percentage_error: 22.6937 - mse: 1551.7825 - r2_score: -0.3850 - val_loss: 23.1075 - val_mae: 23.6019 - val_mean_absolute_percentage_error: 19.0329 - val_mse: 1150.2183 - val_r2_score: -0.0765 - learning_rate: 2.0000e-05\n",
      "Epoch 74/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m8s\u001b[0m 85ms/step - loss: 27.4522 - mae: 27.9488 - mean_absolute_percentage_error: 22.2524 - mse: 1500.1483 - r2_score: -0.3277 - val_loss: 23.1713 - val_mae: 23.6681 - val_mean_absolute_percentage_error: 19.0772 - val_mse: 1156.1716 - val_r2_score: -0.0820 - learning_rate: 2.0000e-05\n",
      "Epoch 75/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 90ms/step - loss: 27.2019 - mae: 27.6980 - mean_absolute_percentage_error: 22.0632 - mse: 1487.5376 - r2_score: -0.3146 - val_loss: 23.0095 - val_mae: 23.5052 - val_mean_absolute_percentage_error: 18.8126 - val_mse: 1157.5431 - val_r2_score: -0.0833 - learning_rate: 2.0000e-05\n",
      "Epoch 76/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 80ms/step - loss: 27.4758 - mae: 27.9713 - mean_absolute_percentage_error: 22.0975 - mse: 1542.1671 - r2_score: -0.3495\n",
      "Epoch 76: ReduceLROnPlateau reducing learning rate to 3.999999898951501e-06.\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m8s\u001b[0m 87ms/step - loss: 27.4738 - mae: 27.9694 - mean_absolute_percentage_error: 22.0977 - mse: 1541.7849 - r2_score: -0.3494 - val_loss: 23.0151 - val_mae: 23.5107 - val_mean_absolute_percentage_error: 18.8351 - val_mse: 1151.7737 - val_r2_score: -0.0779 - learning_rate: 2.0000e-05\n",
      "Epoch 77/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 92ms/step - loss: 27.3036 - mae: 27.7989 - mean_absolute_percentage_error: 21.9245 - mse: 1531.5920 - r2_score: -0.3269 - val_loss: 22.9983 - val_mae: 23.4944 - val_mean_absolute_percentage_error: 18.7894 - val_mse: 1155.9412 - val_r2_score: -0.0818 - learning_rate: 4.0000e-06\n",
      "Epoch 78/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 91ms/step - loss: 26.4847 - mae: 26.9807 - mean_absolute_percentage_error: 21.8186 - mse: 1400.2971 - r2_score: -0.3188 - val_loss: 23.0347 - val_mae: 23.5304 - val_mean_absolute_percentage_error: 18.8626 - val_mse: 1154.2887 - val_r2_score: -0.0803 - learning_rate: 4.0000e-06\n",
      "Epoch 79/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m8s\u001b[0m 85ms/step - loss: 26.8311 - mae: 27.3266 - mean_absolute_percentage_error: 21.8312 - mse: 1440.1179 - r2_score: -0.3200 - val_loss: 22.9700 - val_mae: 23.4661 - val_mean_absolute_percentage_error: 18.7952 - val_mse: 1150.9647 - val_r2_score: -0.0772 - learning_rate: 4.0000e-06\n",
      "Epoch 80/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m8s\u001b[0m 87ms/step - loss: 27.4608 - mae: 27.9573 - mean_absolute_percentage_error: 22.3407 - mse: 1511.7233 - r2_score: -0.2891 - val_loss: 23.0050 - val_mae: 23.5003 - val_mean_absolute_percentage_error: 18.8754 - val_mse: 1146.4271 - val_r2_score: -0.0729 - learning_rate: 4.0000e-06\n",
      "Epoch 81/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 90ms/step - loss: 27.3709 - mae: 27.8659 - mean_absolute_percentage_error: 22.3088 - mse: 1509.4769 - r2_score: -0.3327 - val_loss: 23.0227 - val_mae: 23.5177 - val_mean_absolute_percentage_error: 18.9359 - val_mse: 1142.2113 - val_r2_score: -0.0690 - learning_rate: 4.0000e-06\n",
      "Epoch 82/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 90ms/step - loss: 26.6359 - mae: 27.1320 - mean_absolute_percentage_error: 21.6398 - mse: 1441.4760 - r2_score: -0.2827 - val_loss: 23.0301 - val_mae: 23.5243 - val_mean_absolute_percentage_error: 18.9517 - val_mse: 1143.3048 - val_r2_score: -0.0700 - learning_rate: 4.0000e-06\n",
      "Epoch 83/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m8s\u001b[0m 88ms/step - loss: 26.8101 - mae: 27.3060 - mean_absolute_percentage_error: 21.7307 - mse: 1459.6879 - r2_score: -0.3151 - val_loss: 22.8769 - val_mae: 23.3721 - val_mean_absolute_percentage_error: 18.6566 - val_mse: 1150.6157 - val_r2_score: -0.0768 - learning_rate: 4.0000e-06\n",
      "Epoch 84/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 91ms/step - loss: 27.6905 - mae: 28.1860 - mean_absolute_percentage_error: 22.4072 - mse: 1548.2910 - r2_score: -0.3319 - val_loss: 23.0102 - val_mae: 23.5055 - val_mean_absolute_percentage_error: 18.8870 - val_mse: 1148.2430 - val_r2_score: -0.0746 - learning_rate: 4.0000e-06\n",
      "Epoch 85/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m8s\u001b[0m 83ms/step - loss: 27.0196 - mae: 27.5153 - mean_absolute_percentage_error: 21.9843 - mse: 1463.3458 - r2_score: -0.3101 - val_loss: 22.9380 - val_mae: 23.4332 - val_mean_absolute_percentage_error: 18.7639 - val_mse: 1149.5043 - val_r2_score: -0.0758 - learning_rate: 4.0000e-06\n",
      "Epoch 86/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 88ms/step - loss: 27.0446 - mae: 27.5410 - mean_absolute_percentage_error: 22.1053 - mse: 1458.0435 - r2_score: -0.3186 - val_loss: 23.0668 - val_mae: 23.5613 - val_mean_absolute_percentage_error: 18.9764 - val_mse: 1147.3590 - val_r2_score: -0.0738 - learning_rate: 4.0000e-06\n",
      "Epoch 87/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 90ms/step - loss: 26.7091 - mae: 27.2035 - mean_absolute_percentage_error: 21.7840 - mse: 1434.4172 - r2_score: -0.3088 - val_loss: 22.9270 - val_mae: 23.4223 - val_mean_absolute_percentage_error: 18.7314 - val_mse: 1150.2966 - val_r2_score: -0.0765 - learning_rate: 4.0000e-06\n",
      "Epoch 88/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 105ms/step - loss: 27.1494 - mae: 27.6439 - mean_absolute_percentage_error: 22.0706 - mse: 1473.6832 - r2_score: -0.3372 - val_loss: 23.0489 - val_mae: 23.5440 - val_mean_absolute_percentage_error: 18.9593 - val_mse: 1145.0804 - val_r2_score: -0.0717 - learning_rate: 4.0000e-06\n",
      "Epoch 89/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 107ms/step - loss: 26.5687 - mae: 27.0647 - mean_absolute_percentage_error: 21.7343 - mse: 1437.2034 - r2_score: -0.3173 - val_loss: 23.1668 - val_mae: 23.6615 - val_mean_absolute_percentage_error: 19.1643 - val_mse: 1143.1505 - val_r2_score: -0.0698 - learning_rate: 4.0000e-06\n",
      "Epoch 90/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 100ms/step - loss: 26.8491 - mae: 27.3433 - mean_absolute_percentage_error: 21.6151 - mse: 1497.1188 - r2_score: -0.3211 - val_loss: 22.9935 - val_mae: 23.4890 - val_mean_absolute_percentage_error: 18.8551 - val_mse: 1148.9524 - val_r2_score: -0.0753 - learning_rate: 4.0000e-06\n",
      "Epoch 91/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 95ms/step - loss: 26.7393 - mae: 27.2352 - mean_absolute_percentage_error: 21.6722 - mse: 1476.6508 - r2_score: -0.3110 - val_loss: 23.0158 - val_mae: 23.5115 - val_mean_absolute_percentage_error: 18.9009 - val_mse: 1147.4938 - val_r2_score: -0.0739 - learning_rate: 4.0000e-06\n",
      "Epoch 92/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 99ms/step - loss: 26.5698 - mae: 27.0656 - mean_absolute_percentage_error: 21.9199 - mse: 1410.1272 - r2_score: -0.3103 - val_loss: 22.9591 - val_mae: 23.4534 - val_mean_absolute_percentage_error: 18.8269 - val_mse: 1143.8029 - val_r2_score: -0.0705 - learning_rate: 4.0000e-06\n",
      "Epoch 93/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 81ms/step - loss: 27.1325 - mae: 27.6281 - mean_absolute_percentage_error: 22.0579 - mse: 1490.6245 - r2_score: -0.3571\n",
      "Epoch 93: ReduceLROnPlateau reducing learning rate to 7.999999979801942e-07.\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 91ms/step - loss: 27.1351 - mae: 27.6307 - mean_absolute_percentage_error: 22.0599 - mse: 1490.9321 - r2_score: -0.3571 - val_loss: 23.0302 - val_mae: 23.5238 - val_mean_absolute_percentage_error: 18.9343 - val_mse: 1146.2452 - val_r2_score: -0.0727 - learning_rate: 4.0000e-06\n",
      "Epoch 94/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 91ms/step - loss: 26.6049 - mae: 27.1002 - mean_absolute_percentage_error: 21.6001 - mse: 1446.0206 - r2_score: -0.3246 - val_loss: 22.9996 - val_mae: 23.4943 - val_mean_absolute_percentage_error: 18.8677 - val_mse: 1149.1133 - val_r2_score: -0.0754 - learning_rate: 8.0000e-07\n",
      "Epoch 95/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m8s\u001b[0m 86ms/step - loss: 26.6741 - mae: 27.1696 - mean_absolute_percentage_error: 21.6408 - mse: 1435.4919 - r2_score: -0.3270 - val_loss: 23.0177 - val_mae: 23.5122 - val_mean_absolute_percentage_error: 18.8955 - val_mse: 1149.0885 - val_r2_score: -0.0754 - learning_rate: 8.0000e-07\n",
      "Epoch 96/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 90ms/step - loss: 27.5153 - mae: 28.0109 - mean_absolute_percentage_error: 22.3059 - mse: 1524.0994 - r2_score: -0.3413 - val_loss: 22.9955 - val_mae: 23.4904 - val_mean_absolute_percentage_error: 18.8473 - val_mse: 1150.7250 - val_r2_score: -0.0769 - learning_rate: 8.0000e-07\n",
      "Epoch 97/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 87ms/step - loss: 26.9540 - mae: 27.4488 - mean_absolute_percentage_error: 22.0825 - mse: 1458.8746 - r2_score: -0.3039 - val_loss: 22.9909 - val_mae: 23.4860 - val_mean_absolute_percentage_error: 18.8394 - val_mse: 1150.9537 - val_r2_score: -0.0772 - learning_rate: 8.0000e-07\n",
      "Epoch 98/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m8s\u001b[0m 87ms/step - loss: 27.1997 - mae: 27.6970 - mean_absolute_percentage_error: 22.0124 - mse: 1493.5431 - r2_score: -0.3206 - val_loss: 22.9869 - val_mae: 23.4826 - val_mean_absolute_percentage_error: 18.8246 - val_mse: 1151.9207 - val_r2_score: -0.0781 - learning_rate: 8.0000e-07\n",
      "Epoch 99/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 93ms/step - loss: 26.3913 - mae: 26.8875 - mean_absolute_percentage_error: 21.6903 - mse: 1348.8425 - r2_score: -0.2735 - val_loss: 23.0192 - val_mae: 23.5137 - val_mean_absolute_percentage_error: 18.8926 - val_mse: 1149.6228 - val_r2_score: -0.0759 - learning_rate: 8.0000e-07\n",
      "Epoch 100/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 96ms/step - loss: 27.0499 - mae: 27.5462 - mean_absolute_percentage_error: 21.9846 - mse: 1480.6389 - r2_score: -0.3656 - val_loss: 23.0070 - val_mae: 23.5017 - val_mean_absolute_percentage_error: 18.8804 - val_mse: 1148.1000 - val_r2_score: -0.0745 - learning_rate: 8.0000e-07\n",
      "Epoch 101/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 96ms/step - loss: 26.9748 - mae: 27.4698 - mean_absolute_percentage_error: 21.9374 - mse: 1485.1077 - r2_score: -0.3134 - val_loss: 22.9948 - val_mae: 23.4895 - val_mean_absolute_percentage_error: 18.8518 - val_mse: 1149.2540 - val_r2_score: -0.0756 - learning_rate: 8.0000e-07\n",
      "Epoch 102/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 106ms/step - loss: 27.4443 - mae: 27.9389 - mean_absolute_percentage_error: 22.1584 - mse: 1512.7811 - r2_score: -0.3075 - val_loss: 23.0249 - val_mae: 23.5202 - val_mean_absolute_percentage_error: 18.9021 - val_mse: 1148.8911 - val_r2_score: -0.0752 - learning_rate: 8.0000e-07\n",
      "Epoch 103/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 91ms/step - loss: 26.8161 - mae: 27.3119 - mean_absolute_percentage_error: 21.7349 - mse: 1467.6963 - r2_score: -0.3183\n",
      "Epoch 103: ReduceLROnPlateau reducing learning rate to 1.600000018697756e-07.\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 101ms/step - loss: 26.8187 - mae: 27.3144 - mean_absolute_percentage_error: 21.7366 - mse: 1467.8605 - r2_score: -0.3184 - val_loss: 23.0172 - val_mae: 23.5128 - val_mean_absolute_percentage_error: 18.8858 - val_mse: 1149.6913 - val_r2_score: -0.0760 - learning_rate: 8.0000e-07\n",
      "Epoch 104/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 96ms/step - loss: 27.5347 - mae: 28.0304 - mean_absolute_percentage_error: 21.9713 - mse: 1550.2606 - r2_score: -0.3277 - val_loss: 22.9950 - val_mae: 23.4894 - val_mean_absolute_percentage_error: 18.8424 - val_mse: 1150.5228 - val_r2_score: -0.0767 - learning_rate: 1.6000e-07\n",
      "Epoch 105/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 82ms/step - loss: 26.9819 - mae: 27.4772 - mean_absolute_percentage_error: 21.8051 - mse: 1495.0452 - r2_score: -0.3073 - val_loss: 22.9706 - val_mae: 23.4651 - val_mean_absolute_percentage_error: 18.7802 - val_mse: 1154.2241 - val_r2_score: -0.0802 - learning_rate: 1.6000e-07\n",
      "Epoch 106/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 97ms/step - loss: 27.0203 - mae: 27.5151 - mean_absolute_percentage_error: 21.6763 - mse: 1488.2736 - r2_score: -0.2980 - val_loss: 22.9737 - val_mae: 23.4678 - val_mean_absolute_percentage_error: 18.7900 - val_mse: 1153.7069 - val_r2_score: -0.0797 - learning_rate: 1.6000e-07\n",
      "Epoch 107/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 91ms/step - loss: 27.6391 - mae: 28.1348 - mean_absolute_percentage_error: 22.4608 - mse: 1532.5945 - r2_score: -0.3487 - val_loss: 23.0162 - val_mae: 23.5116 - val_mean_absolute_percentage_error: 18.8835 - val_mse: 1149.9894 - val_r2_score: -0.0763 - learning_rate: 1.6000e-07\n",
      "Epoch 108/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 90ms/step - loss: 27.4590 - mae: 27.9537 - mean_absolute_percentage_error: 22.3809 - mse: 1508.6029 - r2_score: -0.3425 - val_loss: 22.9901 - val_mae: 23.4845 - val_mean_absolute_percentage_error: 18.8295 - val_mse: 1151.6799 - val_r2_score: -0.0778 - learning_rate: 1.6000e-07\n",
      "Epoch 109/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 89ms/step - loss: 26.8281 - mae: 27.3236 - mean_absolute_percentage_error: 21.6186 - mse: 1465.5686 - r2_score: -0.3257 - val_loss: 22.9622 - val_mae: 23.4569 - val_mean_absolute_percentage_error: 18.7689 - val_mse: 1154.1106 - val_r2_score: -0.0801 - learning_rate: 1.6000e-07\n",
      "Epoch 110/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 87ms/step - loss: 27.1351 - mae: 27.6306 - mean_absolute_percentage_error: 22.0362 - mse: 1480.5667 - r2_score: -0.3235 - val_loss: 22.9745 - val_mae: 23.4692 - val_mean_absolute_percentage_error: 18.8021 - val_mse: 1152.1938 - val_r2_score: -0.0783 - learning_rate: 1.6000e-07\n",
      "Epoch 111/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 107ms/step - loss: 27.0439 - mae: 27.5396 - mean_absolute_percentage_error: 22.0420 - mse: 1476.1790 - r2_score: -0.3121 - val_loss: 23.0372 - val_mae: 23.5320 - val_mean_absolute_percentage_error: 18.9249 - val_mse: 1148.6893 - val_r2_score: -0.0750 - learning_rate: 1.6000e-07\n",
      "Epoch 112/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m8s\u001b[0m 78ms/step - loss: 27.1744 - mae: 27.6704 - mean_absolute_percentage_error: 22.1836 - mse: 1474.7087 - r2_score: -0.3598 - val_loss: 22.9752 - val_mae: 23.4706 - val_mean_absolute_percentage_error: 18.7976 - val_mse: 1152.6348 - val_r2_score: -0.0787 - learning_rate: 1.6000e-07\n",
      "Epoch 113/200\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 83ms/step - loss: 27.5435 - mae: 28.0398 - mean_absolute_percentage_error: 22.1094 - mse: 1531.2783 - r2_score: -0.2955\n",
      "Epoch 113: ReduceLROnPlateau reducing learning rate to 3.199999980552093e-08.\n",
      "\u001b[1m95/95\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 92ms/step - loss: 27.5395 - mae: 28.0358 - mean_absolute_percentage_error: 22.1090 - mse: 1530.7513 - r2_score: -0.2958 - val_loss: 22.9719 - val_mae: 23.4668 - val_mean_absolute_percentage_error: 18.7959 - val_mse: 1152.1617 - val_r2_score: -0.0783 - learning_rate: 1.6000e-07\n"
     ]
    }
   ],
   "source": [
    "history = model.fit(\n",
    "    X_train, y_train,\n",
    "    validation_data=(X_val, y_val),\n",
    "    epochs=200,\n",
    "    batch_size=64,\n",
    "    callbacks=callbacks,\n",
    "    verbose=1\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "id": "c9c66647-40ae-48bc-bbdf-c12cd1e97b6b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(6072, 100, 2)\n",
      "(6072, 1)\n"
     ]
    }
   ],
   "source": [
    "print(X_train.shape)\n",
    "print(y_train.shape)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "id": "61a11f93-6b35-42d9-a8e7-4e76cab97a95",
   "metadata": {},
   "outputs": [],
   "source": [
    "y_train = y_train.reshape(-1, 1)\n",
    "y_val = y_val.reshape(-1, 1)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "id": "1978e6c8-b100-4c0e-b3cc-9d7e2c488c91",
   "metadata": {},
   "outputs": [],
   "source": [
    "X_train = np.array(X_train)\n",
    "y_train = np.array(y_train)\n",
    "X_val = np.array(X_val)\n",
    "y_val = np.array(y_val)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8e28cc2e-bc72-4d36-ab94-ca4990e1c2d0",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
